home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / edit / jed207.lha / src / jed.lha / jed.h < prev    next >
C/C++ Source or Header  |  1993-01-15  |  4KB  |  189 lines

  1.  
  2. /*
  3.  * JED.H
  4.  * (c) 1992-3 J.Harper
  5.  */
  6.  
  7. #ifndef JED_H
  8. #define JED_H
  9.  
  10. #define     INTUI_V36_NAMES_ONLY
  11. #include <exec/lists.h>
  12. #include <exec/memory.h>
  13. #include <exec/libraries.h>
  14. #include <clib/asl_protos.h>
  15. #include <clib/diskfont_protos.h>
  16. #include <clib/dos_protos.h>
  17. #include <dos/dostags.h>
  18. #include <clib/exec_protos.h>
  19. #include <clib/gadtools_protos.h>
  20. #include <clib/graphics_protos.h>
  21. #include <clib/iffparse_protos.h>
  22. #include <libraries/iffparse.h>
  23. #include <clib/intuition_protos.h>
  24. #include <clib/keymap_protos.h>
  25. #include <clib/rexxsyslib_protos.h>
  26. #include <ctype.h>
  27. #include <string.h>
  28. #include <stdlib.h>
  29. #include "command.h"
  30.  
  31. #ifndef NOREGEXP
  32. #include <regexp.h>
  33. #endif
  34.  
  35. #define     freestring(s) if(s)FreeVec(s)
  36.  
  37. /*
  38.  * Line structure -- an array of these is in the TX->tx_Lines
  39.  */
  40. typedef struct LINE
  41. {
  42.     LONG         ln_Strlen; /* includes '\0' */
  43.     STRPTR         ln_Line;
  44. } LINE;
  45.  
  46. /*
  47.  * structure to uniquely identify a character position
  48.  */
  49. typedef struct POS
  50. {
  51.     LONG         pos_Line;
  52.     WORD         pos_Col;
  53. } POS;
  54.  
  55. /*
  56.  * Each bookmark has one of these in the tx_Marks list, the max number of
  57.  * bookmarks is 65536 (±32768)
  58.  */
  59. typedef struct MARK
  60. {
  61.     struct MinNode   mk_Node;
  62.     POS             mk_Pos;
  63.     WORD         mk_Index;
  64. } MARK;
  65.  
  66. /*
  67.  * Prefs structure -- all values local to each window, new windows inherit
  68.  * PREFS from their parent.
  69.  */
  70. typedef struct PREFS
  71. {
  72.     BOOL         prf_WordWrap;
  73.     BOOL         prf_AutoIndent;
  74.     BOOL         prf_NoSnapshotWin;
  75.     WORD         prf_TabSize;
  76.     WORD         prf_DiskTab;
  77.     WORD         prf_SaveTabs;
  78.     WORD         prf_LeftMargin;
  79.     WORD         prf_RightMargin;
  80.     UBYTE         prf_FontName[30];
  81.     LONG         prf_FontSize;
  82.     UBYTE         prf_BakDir[100];
  83.     WORD         prf_MaxBak;
  84.     UBYTE         prf_ScreenName[100];
  85. } PREFS;
  86.  
  87. /*
  88.  * each separate file has one of these
  89.  */
  90. typedef struct TX
  91. {
  92.     struct MinNode   tx_Node;
  93.     struct MinList   tx_Views;
  94.     struct MinList   tx_Marks;
  95.     LINE        *tx_Lines;
  96.     LONG         tx_NumLines;
  97.     LONG         tx_Changes;
  98.     STRPTR         tx_FileName;
  99.     STRPTR         tx_TitleName;
  100.     BOOL         tx_ResetPrefs;    /* if TRUE vw_Prefs is reset to default when a new file is edited */
  101. } TX;
  102.  
  103. /*
  104.  * structure for each window (view)
  105.  */
  106. typedef struct VW
  107. {
  108.     struct MinNode   vw_Node;
  109.     struct Window   *vw_Window;
  110.     struct RastPort *vw_Rp;
  111.     TX            *vw_Tx;
  112.  
  113.     POS             vw_CursorPos;
  114.     POS             vw_AutoMark;
  115.     POS             vw_Block[2];
  116.     WORD         vw_BlockStatus;    /* 0=block marked, 1=start marked, 2=end marked, -1=none marked */
  117.     LONG         vw_StartLine;
  118.     WORD         vw_StartCol;
  119.  
  120.     STRPTR         vw_LastTitle;
  121.     BOOL         vw_NonStdTitle;
  122.  
  123.     BOOL         vw_Sleeping;
  124.     BOOL         vw_DisplayLock;
  125.     ULONG         vw_ClickSecs, vw_ClickMics;
  126.  
  127.     WORD         vw_OldDimensions[4];   /* l,t,w,h */
  128.     WORD         vw_MaxX, vw_MaxY;
  129.     UWORD         vw_XStartPix, vw_YStartPix;
  130.     UWORD         vw_XEndPix, vw_YEndPix;
  131.     UWORD         vw_XWidthPix, vw_YHeightPix;
  132.     UWORD         vw_XStep;
  133.     struct TextFont *vw_Font;
  134.     UWORD         vw_FontStart;
  135.     WORD         vw_FontX, vw_FontY;
  136.  
  137.     UWORD         vw_RefreshType;
  138.     POS             vw_RefreshPos;
  139.     LONG         vw_LastRefresh;    /* change count at last refresh */
  140.     WORD         vw_DeferRefresh;
  141.  
  142.     struct {
  143.     LONG         line;
  144.     STRPTR         text;
  145.     LONG         changes;
  146.     }             vw_LineUndo;
  147.  
  148. #ifndef NOREGEXP
  149.     struct {
  150.     regexp        *prog;
  151.     POS         matchpos;
  152.     LONG         changes;
  153.     }             vw_LastRE;
  154. #endif
  155.  
  156.     PREFS         vw_Prefs;
  157. } VW;
  158.  
  159. /*
  160.  * refresh types -- in descending priority.
  161.  */
  162. #define RFF_ALL         1        /* all of page is redrawn */
  163. #define RFF_ALLFROM  2        /* all of page from vw_RefreshPos is redrawn */
  164. #define RFF_CURSLINE 4        /* line of cursor is redrawn */
  165. #define RFF_LINEFROM 8        /* all of line from vw_RefreshPos is redrawn */
  166.  
  167. #define ON  1
  168. #define OFF 0
  169.  
  170. /*
  171.  * some macros for using MinLists
  172.  */
  173. #define AddMTail(l,n)    AddTail((struct List *)l, (struct Node *)n)
  174. #define InsertM(l,n,ln) Insert((struct List *)l, (struct Node *)n, (struct Node *)ln)
  175. #define RemoveM(n)    Remove((struct Node *)n)
  176. #define NewMList(l)    NewList((struct List *)l)
  177. #define IsMListEmpty(l) IsListEmpty((struct List *)l)
  178. #define IsLastMNode(n)    (!((n)->mln_Succ))
  179.  
  180. #define Prototype extern
  181.  
  182. #ifdef DEBUG        /* make static variables viewable for debugging */
  183. #define Local
  184. #else
  185. #define Local      static
  186. #endif
  187.  
  188. #endif /* JED_DEF_H */
  189.